home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-07 | 17.5 KB | 776 lines | [TEXT/MSWD] |
- This document reads best when displayed in a mono-spaced font
-
- Exported using the Power Tools stack 12/7/92. Sorry for the excessive
- duplication between different backgrounds. Make sure you know exactly
- what you’re reading when you work with this. -Simon St.Laurent
-
- •-•-•-• STACK: Hypertype 1.5 •-•-•-•
-
- •-•-•-• STACK SCRIPT: •-•-•-•
-
- on openStack
- global viz
- -- sets visual effects on/off for stack: 1=on, 2=off
- hide menuBar
- set scriptTextFont to "N Helvetica Narrow"
- set scriptTextSize to 12
- push first card
- push first card
- push first card
- if the hilite of card button id 12 of card id 2843 is false then put 2 into viz else put 1 into viz
- set the dontSearch of card id 2843 to true
- set the dontSearch of card "Help 1" to true
- end openStack
-
- on neWline
- put the userLevel into current
- set the userLevel to 5
- ask "name of line?"
- put it into lname
- if lname is empty then exit neWline
- lock screen
- -- put l(ine)name into the lines field
- go to card id 2843
- set the lockText of card field 3 to false
- put the number of lines in card field 3 into muck
- put lname into line muck+1 of card field 3
- set the lockText of card field 3 to true
- go to card "base 1"
- doMenu "new card"
- set the name of this card to lname & " 1"
- go to previous card
- go to next card
- set the userlevel to current
- end neWline
-
- on hyPerize
- set the cursor to watch
- put the number of lines in card field 3 of card id 2843 into trips
- set lockMessages to true
- repeat with x=1 to trips
- unmark all cards
- put line x of card field 3 of card id 2843 into sstr
- -- sstr is search string
- mark cards by finding sstr
- go to card id 2843
- repeat with y=1 to number of marked cards
- go to the next marked card
- find whole sstr
- put the foundChunk into firs
- select the foundChunk
- doMenu "plain"
- doMenu "bold"
- doMenu "italic"
- doMenu "group"
- select after firs
- -- this section temporarily deleted. Need to figure out how to search multiple times within
- -- the same field of a card.
- -- repeat
- -- find whole sstr
- -- put the foundChunk into zip
- -- if zip=firs then exit repeat
- -- select the foundChunk
- -- doMenu "plain"
- -- doMenu "bold"
- -- doMenu "italic"
- -- doMenu "group"
- -- select after zip
- -- end repeat
- end repeat
- end repeat
- end hyPerize
-
-
-
- •-•-•-• BACKGROUND SCRIPT: hypertype •-•-•-•
-
- on openCard
- put the short name of this card into place
- put last char of place into num
- if num=1 then
- hide bg button 3
- delete last char of place
- else
- show bg button 3
- end if
- put place into field "headline"
- if num<>1 then delete last char of place
- put num+1 into check
- if there is a card place & check then
- show bg button 4
- hide bg button id 15
- else
- hide bg button 4
- show bg button id 15
- end if
- end openCard
-
- on newCard
- get line one of card field six of card id 2843
- put it && the date into field Author
- end newCard
-
- on cardMake
- put the short name of this card into place
- put the last char of place into num
- delete last char of place
- put num+1 into new
- if there is a card place & new then
- answer "you must be on the last card of a section to create a new card."
- else
- lock screen
- doMenu "new card"
- set the name of this card to place & new
- go back
- set lockScreen to false
- go to card place & new
- end if
- end cardMake
-
- on controlKey key
- if key is 2 then doMenu "bold"
- if key is 9 then doMenu "italic"
- if key is 21 then doMenu "underline"
- if key is 14 or key is 16 then doMenu "plain"
- if key is 7 then doMenu "group"
- end controlKey
-
-
- •-•-•-• BACKGROUND BUTTON SCRIPTS •-•-•-•
-
- •-•-•-• BUTTON: bkgnd button "Backbranch "
-
- on mouseUp
- global viz
- if viz=1 then visual effect zoom in
- pop card
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "escape!"
-
- on mouseUp
- if this is the first card then
- answer "Do you want to quit?" with "Yes" or "No"
- if it is "yes" then doMenu "quit"
- wait 1
- else
- push card
- go to first card
- end if
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "last card"
-
- on mouseUp
- global viz
- if viz=1 then visual effect scroll right
- put the short name of this card into place
- put the last char of place into number
- delete the last char of place
- put number-1 into dest
- go to card place & dest
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "next card"
-
- on mouseUp
- global viz
- if viz=1 then visual effect scroll left
- put the short name of this card into place
- put the last char of place into number
- delete the last char of place
- put number+1 into dest
- go to card place & dest
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "New Card"
-
- on mouseUp
- cardMake
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "New Line"
-
- on mouseUp
- push card
- neWline
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "Show Footnotes"
-
- on mouseUp
- doMenu "background"
- if the visible of background field 5 is true then
- set the visible of background field 5 to false
- set the visible of background button id 20 to false
- else
- set the visible of background field 5 to true
- set the visible of background button id 20 to true
- end if
- doMenu "background"
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "Open Body"
-
- on mouseUp
- doMenu "background"
- if the lockText of background field 2 is true then set the lockText of background field 2 to false else set the lockText of background field 2 to true
- doMenu "background"
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "help"
-
- on mouseUp
- push card
- go to card "Help 1"
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "Lock Footnotes"
-
- on mouseUp
- doMenu "background"
- if the lockText of background field 5 is true then set the lockText of background field 5 to false¬
- else set the lockText of background field 5 to true
- doMenu "background"
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "escape!"
-
- on mouseUp
- put the id of the first card into it
- if the id of this card = it then
- answer "Do you want to quit?" with "Yes" or "No"
- if it is "yes" then doMenu "quit"
- wait 1
- else
- push card
- go to first card
- end if
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "escape!"
-
- on mouseUp
- put the id of the first card into it
- if the id of this card = it then
- answer "Do you want to quit?" with "Yes" or "No"
- if it is "yes" then doMenu "quit hypercard"
- wait 1
- else
- push card
- go to first card
- end if
- end mouseUp
-
- •-•-•-• BACKGROUND FIELD SCRIPTS •-•-•-•
-
- •-•-•-• FIELD: bkgnd field "Body"
-
- on mouseUp
- global viz
- put the clickText into place
- put place & " 1" into test
- if test is " 1" then wait 1
- else
- put the short name of this card into junk
- delete the last word of junk
- if junk <> place then
- if there is a card test then
- push card
- if viz=1 then visual effect zoom out
- go to card test
- end if
- else
- wait 1
- end if
- end if
- end mouseUp
-
- •-•-•-• FIELD: bkgnd field "footnote"
-
- on mouseUp
-
- end mouseUp
-
-
- •-•-•-• BACKGROUND SCRIPT: hypertype •-•-•-•
-
- on openCard
- put the short name of this card into place
- put last char of place into num
- if num=1 then
- hide bg button 3
- delete last char of place
- else
- show bg button 3
- end if
- put place into field "headline"
- if num<>1 then delete last char of place
- put num+1 into check
- if there is a card place & check then
- show bg button 4
- hide bg button id 15
- else
- hide bg button 4
- show bg button id 15
- end if
- end openCard
-
- on newCard
- get line one of card field six of card id 2843
- put it && the date into field Author
- end newCard
-
- on cardMake
- put the short name of this card into place
- put the last char of place into num
- delete last char of place
- put num+1 into new
- if there is a card place & new then
- answer "you must be on the last card of a section to create a new card."
- else
- lock screen
- doMenu "new card"
- set the name of this card to place & new
- go back
- set lockScreen to false
- go to card place & new
- end if
- end cardMake
-
- on controlKey key
- if key is 2 then doMenu "bold"
- if key is 9 then doMenu "italic"
- if key is 21 then doMenu "underline"
- if key is 14 or key is 16 then doMenu "plain"
- if key is 7 then doMenu "group"
- end controlKey
-
-
- •-•-•-• BACKGROUND BUTTON SCRIPTS •-•-•-•
-
- •-•-•-• BUTTON: bkgnd button "Backbranch "
-
- on mouseUp
- global viz
- if viz=1 then visual effect zoom in
- pop card
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "escape!"
-
- on mouseUp
- if this is the first card then
- answer "Do you want to quit?" with "Yes" or "No"
- if it is "yes" then doMenu "quit"
- wait 1
- else
- push card
- go to first card
- end if
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "last card"
-
- on mouseUp
- global viz
- if viz=1 then visual effect scroll right
- put the short name of this card into place
- put the last char of place into number
- delete the last char of place
- put number-1 into dest
- go to card place & dest
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "next card"
-
- on mouseUp
- global viz
- if viz=1 then visual effect scroll left
- put the short name of this card into place
- put the last char of place into number
- delete the last char of place
- put number+1 into dest
- go to card place & dest
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "New Card"
-
- on mouseUp
- cardMake
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "New Line"
-
- on mouseUp
- push card
- neWline
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "Show Footnotes"
-
- on mouseUp
- doMenu "background"
- if the visible of background field 5 is true then
- set the visible of background field 5 to false
- set the visible of background button id 20 to false
- else
- set the visible of background field 5 to true
- set the visible of background button id 20 to true
- end if
- doMenu "background"
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "Open Body"
-
- on mouseUp
- doMenu "background"
- if the lockText of background field 2 is true then set the lockText of background field 2 to false else set the lockText of background field 2 to true
- doMenu "background"
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "help"
-
- on mouseUp
- push card
- go to card "Help 1"
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "Lock Footnotes"
-
- on mouseUp
- doMenu "background"
- if the lockText of background field 5 is true then set the lockText of background field 5 to false¬
- else set the lockText of background field 5 to true
- doMenu "background"
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "escape!"
-
- on mouseUp
- put the id of the first card into it
- if the id of this card = it then
- answer "Do you want to quit?" with "Yes" or "No"
- if it is "yes" then doMenu "quit"
- wait 1
- else
- push card
- go to first card
- end if
- end mouseUp
-
- •-•-•-• BUTTON: bkgnd button "escape!"
-
- on mouseUp
- put the id of the first card into it
- if the id of this card = it then
- answer "Do you want to quit?" with "Yes" or "No"
- if it is "yes" then doMenu "quit hypercard"
- wait 1
- else
- push card
- go to first card
- end if
- end mouseUp
-
- •-•-•-• BACKGROUND FIELD SCRIPTS •-•-•-•
-
- •-•-•-• FIELD: bkgnd field "footnote"
-
- on mouseUp
-
- end mouseUp
-
-
- •-•-•-• CARD: start •-•-•-•
-
- •-•-•-• CARD BUTTON SCRIPTS •-•-•-•
-
- •-•-•-• BUTTON: card button id 4
-
- on mouseUp
- pop card
- end mouseUp
-
- •-•-•-• BUTTON: card button "New Line"
-
- on mouseUp
- push card
- neWline
- end mouseUp
-
- •-•-•-• BUTTON: card button "Hypertextualize"
-
- on mouseUp
- hyPerize
- end mouseUp
-
- •-•-•-• BUTTON: card button "Visual Effects"
-
- on mouseUp
- global viz
- if the hilite of card button id 12 is true then
- set the hilite of card button id 12 to false
- put 2 into viz
- else
- set the hilite of card button id 12 to true
- put 1 into viz
- end if
- end mouseUp
-
- •-•-•-• BUTTON: card button "Export Text to file"
-
- on mouseUp
- ask file "Create export file named:" with "hypertype export"
- If it is empty then exit mouseUp
- set the cursor to watch
- put it into fileName
- open file fileName
- push card
- lock screen
- set lockMessages to true
- repeat with I=1 to the number of lines of card field "lines" --cards of bg id 4345
- put line I of card field "lines" of card id 2843 into heads
- write heads to file fileName
- write return to file fileName
- put 1 into count
- put empty into foot
- repeat
- if there is a card heads && count then
- go to card heads && count
- put field "body" into place
- if field "footnote" is not empty then put foot & return & field "footnote" into foot
- write place & " " to file fileName
- else
- exit repeat
- end if
- put count+1 into count
- end repeat
- write return to file fileName
- if foot is not empty then write "Footnotes for " & heads & ":" & return & foot & return to file fileName
- write return to file fileName
- end repeat
- close file fileName
- pop card
- unlock screen
- beep 1
- answer "The export file is complete."
- end mouseUp
-
- •-•-•-• BUTTON: card button "shadow fields"
-
- on mouseUp
- set the hilite of card button id 14 to true
- set the hilite of card button id 15 to false
- push this card
- lock screen
- go to card "Base 1"
- set the style of bg field "Body" to shadow
- pop card
- end mouseUp
-
- •-•-•-• BUTTON: card button "scrolling fields"
-
- on mouseUp
- set the hilite of card button id 15 to true
- set the hilite of card button id 14 to false
- push this card
- lock screen
- go to card "Base 1"
- set the style of bg field "Body" to scrolling
- pop card
- end mouseUp
-
- •-•-•-• BUTTON: card button "Delete line"
-
- on mouseUp
- ask "which line?"
- put it into heads
- if heads is empty then exit mouseUp
- lock screen
- push card
- set the dontSearch of cd field "lines" to false
- set the dontSearch of cd id 2843 to false
- find heads in cd field "lines"
- put the foundLine into muck
- if muck is empty then exit mouseUp
- delete the foundLine
- set the dontSearch of cd field "lines" to true
- set the dontSearch of cd id 2843 to true
- put 1 into count
- -- delete loop
- repeat
- if there is a card heads && count then
- go to card heads && count
- doMenu "delete card"
- else
- exit repeat
- end if
- put count+1 into count
- end repeat
- -- unhypertextualize
- unmark all cards
- mark cards by finding sstr
- go to card id 2843
- repeat with y=1 to number of marked cards
- go to the next marked card
- find whole sstr
- put the foundChunk into firs
- select the foundChunk
- doMenu "plain"
- end repeat
- pop card
- answer heads && "has been deleted."
- end mouseUp
-
- •-•-•-• BUTTON: card button "Change line name"
-
- on mouseUp
- ask "which line?"
- put it into heads
- -- heads variable short for headline
- if heads is empty then exit mouseUp
- ask "change it to what?" with heads
- put it into new
- --new line name
- if new is empty then exit mouseUp
- lock screen
- push card
- set the dontSearch of cd field "lines" to false
- set the dontSearch of cd id 2843 to false
- -- nuisance allowing search on control card
- find heads in cd field "lines"
- put the foundChunk into muck
- -- muck a variable name born of frustration
- if muck is empty then
- answer "no such line"
- exit mouseUp
- end if
- select the foundChunk
- put new into the selection
- put 1 into count
- repeat
- --heads && count will produce a sequence of card names in a line
- if there is a card heads && count then
- go to card heads && count
- set the name of this card to new && count
- else
- exit repeat
- end if
- put count+1 into count
- end repeat
- pop card
- answer heads && "has been changed to" && new & "."
- set the dontSearch of cd field "lines" to true
- set the dontSearch of cd id 2843 to true
- end mouseUp
-
- •-•-•-• BUTTON: card button "Hide first card"
-
- on mouseUp
- answer "This is intended only for when you are finished creating a stack. Are you finished?"¬
- with "yes" or "no"
- if it is "no" then exit mouseUp
- put the first line of card field "lines" into suggestion
- ask "Which line do want to use as the first line?" with suggestion
- put it into newfir
- -- new is new first card
- if newfir is empty then exit mouseUp
- if there is no card newfir && "1" then
- answer "No such line!"
- exit mouseUp
- end if
- go to card newfir && "1"
- doMenu "cut card"
- go to first card
- doMenu "paste card"
- go to first card
- doMenu "cut card"
- go to last card
- doMenu "paste card"
- go to first card
- answer "Finished. If you still need access to the main card, type Command-M to summon the Message box, then type 'go to card id 2843'."
- end mouseUp
-
- •-•-•-• BUTTON: card button "Quit"
-
- on mouseUp
- answer "Do you want to quit?" with "Yes" or "No"
- if it is "yes" then doMenu "quit hypercard"
- end mouseUp
-
- •-•-•-• CARD FIELD SCRIPTS •-•-•-•
-
- •-•-•-• FIELD: card field "Lines"
-
- on mouseUp
- put the clickText into place
- push card
- put place & " 1" into dest
- go to card dest
- end mouseUp
-
- •-•-•-• CARD: Help 1 •-•-•-•
-
- •-•-•-• CARD BUTTON SCRIPTS •-•-•-•
-
- •-•-•-• BUTTON: card button "escape!"
-
- on mouseUp
- put the id of the first card into it
- if the id of this card = it then
- answer "Do you want to quit?" with "Yes" or "No"
- if it is "yes" then doMenu "quit hypercard"
- wait 1
- else
- push card
- go to first card
- end if
- end mouseUp
-
- •-•-•-• BUTTON: card button "last card"
-
- on mouseUp
-
- end mouseUp
-
- •-•-•-• BUTTON: card button "next card"
-
- on mouseUp
-
- end mouseUp
-
- •-•-•-• BUTTON: card button "escape!"
-
- on mouseUp
-
- end mouseUp
-
- •-•-•-• BUTTON: card button "About this stack"
-
- on mouseUp
- show card field "About"
- end mouseUp
-
- •-•-•-• BUTTON: card button "end help"
-
- on mouseUp
- pop card
- end mouseUp
-
- •-•-•-• BUTTON: card button "Backbranch "
-
- on mouseUp
-
- end mouseUp
-
- •-•-•-• CARD FIELD SCRIPTS •-•-•-•
-
- •-•-•-• FIELD: card field "About"
-
- on mouseUp
- hide card field "About"
- end mouseUp
-
-
-